The present invention relates generally to computer systems, methods, and program products, and more particularly to computer systems, methods, and program products for copying data.
Data is frequently maintained on computers in a template format where data is placed in fields within the template. The fields typically have an associated field designation such as a field name and may further include a specification of field size and type. Field type may include text, currency or other data type. An example of a template containing fields is an address directory database including a plurality of records each representing address information for a different customer, client or other contact for an individual or company. The various fields within an address book template may include name, address, city, state, zip code or other field information.
If data is stored on a computer in a template format within fields, a problem may arise when it is necessary to copy data from one template to another. The field designations of a source template may not identically match those of a target template. For example, a user may wish to copy address book information from one application program database to another which uses a slightly modified data field format. Typically, database programs provided with an ability to import records to populate the fields of the database with data assume an import file format based on ordering of the data rather than field designations associated with individual pieces of data in the import file. For example, comma delimited import files may be provided where commas are placed to mark demarcations between fields within a record and CR/LF (carriage return/line feed) characters mark the end of individual records. Import operations copying the import file into the template format of the receiving database then proceed sequentially with field transition and record transition decisions being made based upon the CR/LF and comma characters as they are encountered during the read operation. Similarly, clipboard type copy and paste operations typically provided by various computer operating systems presently in use typically will copy and paste data contained in a template but will do so without maintaining information related to the field designations associated with the various data segments.
These approaches to copying of data to field based templates each have various limitations which create difficulties for a user in copying data from a first template to a second template. Both of these conventional approaches may require user formatting or intervention to provide the logical association between data blocks in the source template and the target location in the destination template. Therefore, it would be desirable to provide improved methods, systems and computer program products for copying between templates.
Accordingly, it is an object of the present invention to provide methods, system:; and computer program products for copying data between templates using field designation information.
It is a further object of the present invention to provide such methods, systems and computer program products that provide for copying of data from matching and non-matching fields.
These and other objects are provided, according to the present invention, by methods, systems and computer program products for copying data between templates having data stored in fields. The field designations of the source and target template are read and compared and data is copied between fields having matching field designations. For example, each field in the target template with the same field name and field size as a field in the source template receives the data from the corresponding field of the first template. Non-matching fields are present d to a user to obtain instructions on how to complete the copying operation. The user may specify concatenation, splitting, or renaming/resizing to provide source data for the target template. Alternatively, the non-matching fields in the target template may be left empty or the user may manually enter data by using a clipboard function or keying in new data.
In one embodiment of the present invention, a method for copying data between templates contained on a computer is provided including receiving a designation of a first template containing data associated with a plurality of fields and of, second template to which the data is to be copied. A first plurality of field designations associated with the fields of the first template and a second plurality of field designations associated with a plurality of fields of the second template are read. Data associated with ones of the plurality of fields of the first template is then co pied to corresponding ones of the plurality of fields of the second template having field designations matching field designations associated with the fields of the first template.
In another embodiment of the present invention, the designation of the first template may be a designation of a portion of the first template containing the data to be copied, the portion including a plurality of the plurality of fields of the first template. In one embodiment the field designations have an associated name and size ant copying is provided by comparing the field designations of the first template to the field designations of the second template to identify ones of the field designations of the first template having associated names and sizes which are identical to ones of the field designations of the second template to determine identical fields. Data associated with identical fields from the first template is copied o the second template.
In a further embodiment of the present invention ones of the first plurality of field designations and ones of the second plurality of field designations having non-matching field designations are displayed to a user. Designations of data to be copied into designated ones of the plurality of fields of the second template are received from the user and the designated data is copied into the designated ones of the plurality of fields of the second template. The user designation may be provided as a user selection of a field designation from the second template to be associated with a field designation selected by the user from the first template for copying data. Alternatively, data may be received from the user for placement in a field of the second template selected by the user.
In another embodiment of the present invention, one of the matching field designations is displayed to a user and a designation of whether copying of a field associated with the displayed field designation is desired is received from the user. Data associated with the field associated with the displayed field designation is copied if the user designations copying as desired. These operations are repeated for each of the matching field designations.
In a further embodiment of the present invention, one of the non-matching field designations is displayed to a user and a designation of a type of copying to be use for the displayed field designation is received from the user. Data is copied into a field of the second template responsive to the received designation of a type of copying to be used. The type of copying may be selected from the group consisting of manual copying, renaming, concatenating and splitting. For manual copying data received from the user is placed in a field of the second template selected by the user. For renaming, at least one of renaming or resizing a field of at least one of the first template or the second template selected by the user to provide a new matching field designation is performed and then data is copied into a field of the second template having a field designation corresponding to the new matching field designation from a field of the first template having a field designation corresponding to the new matching field designation. For concatenating, a plurality of fields of at least one of the first template or the second template selected by the user are concatenated and data is copied from the concatenated plurality of fields to one of the fields of the other of the first template or the second template selected by the user. For splitting, data from a field of at least one of the first template or the second template selected by the user is split into at least two portions and a first one of the portions is copied into a first one of the fields of the other of the first template or the second template selected by the user and a second one of the portions is copied into a second one of the fields of the other of the first template or the second template selected by the user.
In one embodiment of the present invention, copy operations are performed using a clipboard function. In another embodiment, data is copied using memory mapping.
While the invention has been described above primarily with respect to the method aspects of the invention, both systems and computer program products are also provided.
Accordingly, the present invention provides for intelligent copying of data between templates based upon the information contained in the field designations of the source and target templates.